package com.getpebble.android.util;

import com.google.gson.Gson;

public class JSONUtil {
    private static final Gson sGsonInstance = new Gson();

    public static <T> T marshall(String json, Class<T> clazz) throws IllegalArgumentException {
        try {
            return sGsonInstance.fromJson(json, (Class) clazz);
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
    }
}
